using UnityEngine;
using System.Collections;

public class PointNShot : MonoBehaviour 
{
	void Update()
	{
		this.mouseCheck();
	}
	
	void mouseCheck()
	{
		if(Input.GetMouseButtonDown(0))
		{
			this.killProduct();
		}
	}
	
	void killProduct()
	{
		Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
		RaycastHit hit = new RaycastHit();
		
		if(Physics.Raycast(ray, out hit))
		{	
			hit.transform.GetComponent<Product_Script>().Shoot(1);
		}
	}
}
